<html>
<head>
<script>
var slt, slt2;
var opt;

function setSelect(selectElemObj)
{
//remove existing options
//selectElemObj.options.length = 0;
//create and assign options, one by one
//selectElemObj.options[0] = new Option("Hercule Poirot", "poirot", false, false);
selectElemObj.options[31] = new Option("Miss Marple", "marple", false, false);
}

function swapOptions(selectElemObj, srcOptionIndex, tgtOptionIndex)
{
	//selectElemObj.options[1] = new Option("Miss Marple", "marple", false, false);
//alert(srcOptionIndex+"_"+tgtOptionIndex);

	var tempOption_text = selectElemObj.options[srcOptionIndex].text;
	var tempOption_value = selectElemObj.options[srcOptionIndex].value;
	var tempOption1_text = selectElemObj.options[tgtOptionIndex].text;
	var tempOption1_value = selectElemObj.options[tgtOptionIndex].value;
	
	//selectElemObj.options[tgtOptionIndex].text = "";
	//selectElemObj.options[tgtOptionIndex].value = "";
	
	selectElemObj.options[srcOptionIndex].text =selectElemObj.options[tgtOptionIndex].text;// tempOption1_text;
	selectElemObj.options[srcOptionIndex].value =	selectElemObj.options[tgtOptionIndex].value// tempOption1_value;
	selectElemObj.options[srcOptionIndex].selected = false;
	selectElemObj.options[tgtOptionIndex].text = tempOption_text;
	selectElemObj.options[tgtOptionIndex].value = tempOption_value;
	selectElemObj.options[tgtOptionIndex].selected = true;

}

function moveUp()
{
	swapOptions(slt, slt.selectedIndex, slt.selectedIndex - 1);
	//slt.selectedIndex -=1;
}

function moveDown()
{
	swapOptions(slt, slt.selectedIndex, slt.selectedIndex + 1);
}

function remove()
{
	slt.options.length -=1;
}

opt = new Array(90);

for (var i = 0; i < opt.length; i++)
{
	opt[i] = new Option("op"+i, i, false, false);
}

function iterator()
{
	for (i = 0; i < slt.length; i++)
	{
		slt2.length = i + 1;
		slt2.options[i].text = slt.options[i].text;
		slt2.options[i].value = slt.options[i].value;
	}
}

function initOption()
{
	slt = document.getElementById('slt');
	slt2 = document.getElementById('slt2');
	
	slt.options.length = 90;
	
	for (var i = 0; i < slt.options.length; i++)
	{
		slt.options[i] = opt[i];
	}
	
	iterator();
}
</script>
</head>

<body onload="initOption();">
<select id="slt" size="30" style="text-align:center;width:300px;">
</select>
<button onclick="moveUp()">UP</button>
<button onclick="moveDown()">DOWN</button>
<button onclick="remove()">REMOVE</button>
<button onclick="setSelect(slt)">Change It</button>
<select id="slt2" size="30" style="text-align:center;width:300px;">
</select>
</body>
</html>